package com.cq.androidtools.mvp.presenter

import android.os.Handler
import com.cq.androidtools.mvp.model.IUser
import com.cq.androidtools.mvp.model.UserModelImpl
import com.cq.androidtools.mvp.view.ILoginView


/**
 * 作者: CQ
 * 日期: 2021-03-23
 * 说明:
 */
class LoginPresenterImpl(var lLoginView: ILoginView) : ILoginPresenter {

    private var user: IUser = UserModelImpl("wongkyunban", "1688")

    override fun clear() {
        lLoginView.onClearText()
    }

    override fun doLogin(name: String?, password: String?) {
        val isSuccess = user.checkLogin(name, password!!)
        Handler().postDelayed({ lLoginView.onLoginResult(true) }, 3000)
    }


}